﻿using Abp.BackgroundJobs;
using Abp.Dependency;
using Mt.Site.Application.ContentManagement.Dto;
using System.Threading.Tasks;

namespace Mt.Site.Application.ContentManagement
{
    public class ContentRouteGeneratingJob : AsyncBackgroundJob<ContentRouteGeneratingJobArgs>, ITransientDependency
    {
        private readonly ContentRouteGeneratingHelper _contentRouteGeneratingHelper;


        public ContentRouteGeneratingJob(
            ContentRouteGeneratingHelper contentRouteGeneratingHelper)
        {
            _contentRouteGeneratingHelper = contentRouteGeneratingHelper;
        }


        public override async Task ExecuteAsync(ContentRouteGeneratingJobArgs args)
        {
            await _contentRouteGeneratingHelper.GenerateContentUrlAsync();
            await _contentRouteGeneratingHelper.GenerateContent2UrlAsync();
        }
    }
}
